package com.erp.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.HorizontalScrollView;

import com.erp.Interface.HorizontalScrollViewListener;

/**
 * Created by Administrator on 2016/11/3 0003.
 * 暴露Horizontalscrollview滑动监听接口
 */
public class HorizontalObservableScrollView extends HorizontalScrollView {
    private HorizontalScrollViewListener horizontalScrollViewListener=null;
    public HorizontalObservableScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public HorizontalObservableScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public HorizontalObservableScrollView(Context context) {
        super(context);
    }
    public void setHorizontalScrollViewListener(HorizontalScrollViewListener horizontalscrollViewListener) {
        this.horizontalScrollViewListener = horizontalscrollViewListener;
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if(horizontalScrollViewListener!=null){
            horizontalScrollViewListener.onScrollChanged(this,l,t,oldl,oldt);
        }
    }
}
